non-root user.
2. Better handle the debug-printing inside the console
Signed-off-by: Dan Smith <danms@us.ibm.com>
if self.consoleFd in i:
try:
str = os.read(self.consoleFd, 1)
+ if self.debugMe:
+ sys.stdout.write(str)
bytes += 1
except:
raise ConsoleError("Failed to read from console (fd=%i)"
% self.limit)
if str == "\n":
- if self.debugMe:
- print "%s\n" % line
if lines > 0:
output += line + "\n"
if saveHistory:
allusers = pwd.getpwall()
for u in allusers:
if u[0] == "nobody":
- os.seteuid(u[2])
+ os.setreuid(u[2], u[2])
break
if os.geteuid() == 0:
FAIL("Could not become a non-root user")